﻿/**
GridList 增、删、改、查
**/
function viewModel() {
    var self = this;
    this.dataSource = data.dataSource;
    this.form = ko.mapping.fromJS(data.form);
    this.grid = {
        //        size: { w: 260, h: 380 },
        url: '/api/Senv/Aqjb/Get',
        queryParams: { Aqjb_Jbrq: this.dataSource.Jbrq, ApproveState: this.dataSource.State },
        //        queryParams: ko.observable(),
        //pagination: true,
        rownumbers: false,
        idField: 'Aqjb_BillNo'
    };
    this.gridEdit = new com.editTreeGridViewModel(this.grid);
    this.grid.OnAfterCreateEditor = function (edt) {
        com.readOnlyHandler('input')(edt["Aqjb_BillNo"].target, true);
    };
    this.refreshClick = function () {
        window.location.reload();
    };
};

var viewSJ = function (row) {
    if (!row) return com.message('warning', "error");
    com.dialog({
        title: "查看简报",
        width: 700,
        height: 500,
        maximizable: true,
        html: '<iframe id="_view_sys_log_" scrolling="auto" frameborder="0"  style="width:100%;height:100%;"></iframe>',
        viewModel: function (w) {
            w.find("iframe").attr("src", "/Senv/Aqjb/view/" + row["Aqjb_BillNo"]);
        }
    });
};